package com.liangzhong.model.goods.vo
{
	import com.global.GlobalDef;
	import com.liangzhong.model.type.GoodsType;
	import com.liangzhong.model.type.OtherGoodType;

	/**
	 *其他商品 
	 * @author lake
	 * 
	 */	
	public class OtherGoodVo extends GoodsVo
	{
		/**
		 * 其他卡ID
		 */		
		public var otherid 			:int;
		/**
		 * 其他卡名字
		 */		
		public var othername 		:String;
		/**
		 * 类型：
		    1.	欧元卡
			2.	金币卡
			3.	VIP卡
			4.	体力卡
			5.	士气卡
			6.	幸运卡
			7.	召集令
			8.	洗练卡
			9.	药剂
		 */		
		//public var ntype 			:int;
		/**
		 * 对应的值
		 */		
		public var value 			:int;
		
		public function OtherGoodVo()
		{
			super();
		}
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		override public function parse(data :Object):void
		{
			var xmlList:XMLList = data.children();
			for each(var xml:XML in xmlList)
			{
				if(this.hasOwnProperty(xml.localName()))
				{
					this[xml.localName()] = xml.toString();
				}
			}
			name 	= othername;
			url  	= GlobalDef.Web_Res_Url + "prop/" + header;
			type 	= GoodsType.OTHER;
			pid 	= otherid;
			gid		= otherid;
			color	= value;
		}
		/**
		 *获取tips 显示信息 
		 * @return 
		 * 
		 */		
		override public function get tipsInfo():String
		{
			var colors :Array = ["#999999","#00FF66","#0033CC","#660099","#FFFF33","#FF0000","#FFFF00"];
			var colorDesc :Array = ["山寨","廉价","普通","精致","昂贵","顶级","逆天"];
			var info :String = "<p align='left'><font>" + name + "</font>\n";
			switch(ntype)
			{
				case OtherGoodType.CALLINCARD:
				case OtherGoodType.CUIHUAJI:
				{
					info = "<p align='left'><font color='"+ colors[color-1] +"'>" + name + "</font>\n\n";
					info += "品质:" + colorDesc[color-1];
					break;
				}
			}
			info += "</p>";
			descplay = descplay.replace("双击使用","");
			info += "<p align='left'>" + descplay + "</p>";
			switch(ntype)
			{
				case OtherGoodType.EURO:
				case OtherGoodType.FAME:
				{
					info +="<p align='left'><font color='#33ccff'>双击使用</font>";
					break;
				}
				case OtherGoodType.PROTECTCARD:
				{
					info +="<p align='left'><font color='#33ccff'>在研究所中使用</font>";
					break;
				}
				case OtherGoodType.CALLINCARD:
				{
					info +="<p align='left'><font color='#33ccff'>在研究所-->球员合成中使用</font>";
					break;
				}
				case OtherGoodType.CUIHUAJI:
				{
					info +="<p align='left'><font color='#33ccff'>在研究所-->材料合成中使用</font>";
					break;
				}
				case OtherGoodType.FUCKLYCARD:
				{
					info +="<p align='left'><font color='#33ccff'>在研究所-->角色强化中使用</font>";
					break;
				}
			}
			return info;
		}
	}
}